$(function(){
   	var chartDom = document.getElementById('charts');
	var myChart = echarts.init(chartDom);
	myChart.setOption({
		title: {
        	text: '周报表'
	    },
	    tooltip: {},
	    legend: {
	        data:['销量']
	    },
	    xAxis: {
	        data: []
	    },
	    yAxis: {},
	    series: [{
	        name: '销量',
	        type: 'bar',
	        data: []
	    }]
	});
	$.get('weeklyJson').done(function (data) {
		var json = JSON.parse(data);
		yData = json.num;
		xData = json.name;
	    myChart.setOption({
	        xAxis: {
	            data: xData
	        },
	        series: [{
	            name: '销量',
	            data: yData
	        }]
	    });
	});
})